import 'package:k3cloud_api/params/iface_model.dart';
import 'package:k3cloud_api/params/model/current_organization_info.dart';

class UserContext implements IModel {
  String? userLocale;
  String? logLocale;
  String? dBid;
  int? databaseType;
  String? sessionId;
  List<dynamic>? useLanguages;
  int? userId;
  String? userName;
  String? customName;
  String? displayVersion;
  String? dataCenterName;
  String? userToken;
  CurrentOrganizationInfo? currentOrganizationInfo;
  bool? isCH_ZH_AutoTrans;
  int? clientType;
  Map<String, dynamic>? weiboAuthInfo;
  Map<String, dynamic>? uTimeZone;
  Map<String, dynamic>? sTimeZone;
  String? gDCID;
  String? gsid;
  int? tRLevel;
  int? productEdition;
  String? dataCenterNumber;

  UserContext.fromJson(Map<String, dynamic> json) {
    userLocale = json["UserLocale"];
    logLocale = json["LogLocale"];
    dBid = json["DBid"];
    databaseType = json["DatabaseType"];
    useLanguages = json["UseLanguages"];
    userId = json["UserId"];
    userName = json["UserName"];
    customName = json["CustomName"];
    displayVersion = json["DisplayVersion"];
    dataCenterName = json["DataCenterName"];
    userToken = json["UserToken"];
    currentOrganizationInfo = json["CurrentOrganizationInfo"] == null ? null : CurrentOrganizationInfo.fromJson(json["CurrentOrganizationInfo"]);
    isCH_ZH_AutoTrans = json["IsCH_ZH_AutoTrans"];
    clientType = json["ClientType"];
    weiboAuthInfo = json["WeiboAuthInfo"];
    uTimeZone = json["UTimeZone"];
    sTimeZone = json["STimeZone"];
    gDCID = json["GDCID"];
    gsid = json["Gsid"];
    tRLevel = json["TRLevel"];
    productEdition = json["ProductEdition"];
    dataCenterNumber = json["DataCenterNumber"];
  }

  @override
  Map<String, dynamic> toJson() => {
    "UserLocale": userLocale,
    "LogLocale": logLocale,
    "DBid": dBid,
    "DatabaseType": databaseType,
    "UseLanguages": useLanguages,
    "UserId": userId,
    "UserName": userName,
    "CustomName": customName,
    "DisplayVersion": displayVersion,
    "DataCenterName": dataCenterName,
    "UserToken": userToken,
    "CurrentOrganizationInfo": currentOrganizationInfo?.toJson(),
    "IsCH_ZH_AutoTrans": isCH_ZH_AutoTrans,
    "ClientType": clientType,
    "WeiboAuthInfo": weiboAuthInfo,
    "UTimeZone": uTimeZone,
    "STimeZone": sTimeZone,
    "GDCID": gDCID,
    "Gsid": gsid,
    "TRLevel": tRLevel,
    "ProductEdition": productEdition,
    "DataCenterNumber": dataCenterNumber,
  };
}